using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using System.IO.Ports;
using System.Text;

#if MINI
using SecretLabs.NETMF.Hardware.NetduinoMini;
#else
using SecretLabs.NETMF.Hardware.Netduino;
#endif

namespace codebase
{
    public class Window0 : UI.Window
    {
        UI.Frame Frame0;
        UI.Frame Frame1;
        UI.Frame Frame2;
        UI.Button Button0;
        UI.Button Button1;
        UI.Button Button2;
        UI.Button Button3;
        UI.Button Button4;
        UI.Button Button5;
        UI.Button Button6;
        UI.Button Button7;
        UI.Button Button8;
        UI.Button Button9;
        UI.Button Button10;
        UI.Button Button11;
        UI.Button Button12;
        UI.Button Button13;
        UI.Button Button14;
        UI.Button Button15;
        UI.Button Button16;
        UI.Button Button17;
        UI.Button Button18;
        UI.Button Button19;
        UI.Button Button20;
        UI.Button Button21;
        UI.Button Button22;

        public Window0(UI.WindowManager win)
        {
            Initialize(win);
        }

        public void Initialize(UI.WindowManager man)
        {
            base.Initialize(man, 0, 0);
            Text = "Ein Test Fenster , Yeah";

            FullScreen = true;
            DrawBorder = true;

            Frame0 = (UI.Frame)Add(UI.Window.ControlTypes.Frame, 1, 2);
            Frame0.Text = "Ein kleines Frame";
            Frame0.Width = 112;
            Frame0.Height = 72;
            Frame0.BorderColor = ColorExtensions.RGB16(255, 255, 255);
            Frame0.BackgroundColor = ColorExtensions.RGB16(53, 17, 9);

            Frame1 = (UI.Frame)Add(UI.Window.ControlTypes.Frame, 1, 12);
            Frame1.Text = "Ein langes Frame";
            Frame1.Width = 224;
            Frame1.Height = 64;
            Frame1.BorderColor = ColorExtensions.RGB16(27, 30, 54);

            Frame2 = (UI.Frame)Add(UI.Window.ControlTypes.Frame, 1, 21);
            Frame2.Width = 154;
            Frame2.Height = 144;
            Frame2.BackgroundColor = ColorExtensions.RGB16(238, 232, 170);

            Button0 = (UI.Button)Add(UI.Window.ControlTypes.Button, 12, 26);
            Button0.Text = "6";
            Button0.isStateButton = false;
            Button0.Width = 35;
            Button0.Height = 32;
            Button0.NotPressedColor = ColorExtensions.RGB16(152, 251, 152);

            Button1 = (UI.Button)Add(UI.Window.ControlTypes.Button, 7, 26);
            Button1.Text = "5";
            Button1.isStateButton = false;
            Button1.Width = 35;
            Button1.Height = 32;
            Button1.NotPressedColor = ColorExtensions.RGB16(152, 251, 152);

            Button2 = (UI.Button)Add(UI.Window.ControlTypes.Button, 2, 26);
            Button2.Text = "4";
            Button2.isStateButton = false;
            Button2.Width = 35;
            Button2.Height = 32;
            Button2.NotPressedColor = ColorExtensions.RGB16(152, 251, 152);

            Button3 = (UI.Button)Add(UI.Window.ControlTypes.Button, 12, 22);
            Button3.Text = "9";
            Button3.isStateButton = false;
            Button3.Width = 35;
            Button3.Height = 32;
            Button3.NotPressedColor = ColorExtensions.RGB16(152, 251, 152);

            Button4 = (UI.Button)Add(UI.Window.ControlTypes.Button, 7, 22);
            Button4.Text = "8";
            Button4.isStateButton = false;
            Button4.Width = 35;
            Button4.Height = 32;
            Button4.NotPressedColor = ColorExtensions.RGB16(152, 251, 152);

            Button5 = (UI.Button)Add(UI.Window.ControlTypes.Button, 2, 22);
            Button5.Text = "7";
            Button5.isStateButton = false;
            Button5.Width = 35;
            Button5.Height = 32;
            Button5.NotPressedColor = ColorExtensions.RGB16(152, 251, 152);

            Button6 = (UI.Button)Add(UI.Window.ControlTypes.Button, 12, 30);
            Button6.Text = "3";
            Button6.isStateButton = false;
            Button6.Width = 35;
            Button6.Height = 32;
            Button6.NotPressedColor = ColorExtensions.RGB16(152, 251, 152);

            Button7 = (UI.Button)Add(UI.Window.ControlTypes.Button, 7, 30);
            Button7.Text = "2";
            Button7.isStateButton = false;
            Button7.Width = 35;
            Button7.Height = 32;
            Button7.NotPressedColor = ColorExtensions.RGB16(152, 251, 152);

            Button8 = (UI.Button)Add(UI.Window.ControlTypes.Button, 2, 30);
            Button8.Text = "1";
            Button8.isStateButton = false;
            Button8.Width = 35;
            Button8.Height = 32;
            Button8.NotPressedColor = ColorExtensions.RGB16(152, 251, 152);

            Button9 = (UI.Button)Add(UI.Window.ControlTypes.Button, 2, 34);
            Button9.Text = "0";
            Button9.isStateButton = false;
            Button9.Width = 70;
            Button9.Height = 32;
            Button9.NotPressedColor = ColorExtensions.RGB16(152, 251, 152);

            Button10 = (UI.Button)Add(UI.Window.ControlTypes.Button, 12, 34);
            Button10.Text = ",";
            Button10.isStateButton = false;
            Button10.Width = 35;
            Button10.Height = 32;
            Button10.NotPressedColor = ColorExtensions.RGB16(50, 205, 50);

            Button11 = (UI.Button)Add(UI.Window.ControlTypes.Button, 17, 22);
            Button11.Text = "+";
            Button11.isStateButton = false;
            Button11.Width = 35;
            Button11.Height = 32;
            Button11.NotPressedColor = ColorExtensions.RGB16(50, 205, 50);

            Button12 = (UI.Button)Add(UI.Window.ControlTypes.Button, 17, 26);
            Button12.Text = "-";
            Button12.isStateButton = false;
            Button12.Width = 35;
            Button12.Height = 32;
            Button12.NotPressedColor = ColorExtensions.RGB16(50, 205, 50);

            Button13 = (UI.Button)Add(UI.Window.ControlTypes.Button, 17, 30);
            Button13.Text = "*";
            Button13.isStateButton = false;
            Button13.Width = 35;
            Button13.Height = 32;
            Button13.NotPressedColor = ColorExtensions.RGB16(50, 205, 50);

            Button14 = (UI.Button)Add(UI.Window.ControlTypes.Button, 17, 34);
            Button14.Text = "/";
            Button14.isStateButton = false;
            Button14.Width = 35;
            Button14.Height = 32;
            Button14.NotPressedColor = ColorExtensions.RGB16(50, 205, 50);

            Button15 = (UI.Button)Add(UI.Window.ControlTypes.Button, 2, 4);
            Button15.Text = "Button";
            Button15.isStateButton = false;
            Button15.Width = 98;
            Button15.Height = 24;
            Button15.NotPressedColor = ColorExtensions.RGB16(220, 20, 60);
            Button15.ForeColor = ColorExtensions.RGB16(255, 255, 255);

            Button16 = (UI.Button)Add(UI.Window.ControlTypes.Button, 2, 7);
            Button16.Text = "Button";
            Button16.isStateButton = false;
            Button16.Width = 98;
            Button16.Height = 24;
            Button16.NotPressedColor = ColorExtensions.RGB16(220, 20, 60);
            Button16.ForeColor = ColorExtensions.RGB16(255, 255, 255);

            Button17 = (UI.Button)Add(UI.Window.ControlTypes.Button, 2, 14);
            Button17.Text = "1";
            Button17.isStateButton = false;
            Button17.Width = 35;
            Button17.Height = 40;
            Button17.NotPressedColor = ColorExtensions.RGB16(255, 140, 0);

            Button18 = (UI.Button)Add(UI.Window.ControlTypes.Button, 7, 14);
            Button18.Text = "2";
            Button18.isStateButton = false;
            Button18.Width = 35;
            Button18.Height = 40;
            Button18.NotPressedColor = ColorExtensions.RGB16(255, 165, 0);

            Button19 = (UI.Button)Add(UI.Window.ControlTypes.Button, 12, 14);
            Button19.Text = "3";
            Button19.isStateButton = false;
            Button19.Width = 35;
            Button19.Height = 40;
            Button19.NotPressedColor = ColorExtensions.RGB16(255, 222, 173);

            Button20 = (UI.Button)Add(UI.Window.ControlTypes.Button, 17, 14);
            Button20.Text = "4";
            Button20.isStateButton = false;
            Button20.Width = 35;
            Button20.Height = 40;
            Button20.NotPressedColor = ColorExtensions.RGB16(255, 228, 196);

            Button21 = (UI.Button)Add(UI.Window.ControlTypes.Button, 22, 14);
            Button21.Text = "5";
            Button21.isStateButton = false;
            Button21.Width = 35;
            Button21.Height = 40;
            Button21.NotPressedColor = ColorExtensions.RGB16(253, 245, 230);

            Button22 = (UI.Button)Add(UI.Window.ControlTypes.Button, 27, 14);
            Button22.Text = "6";
            Button22.isStateButton = false;
            Button22.Width = 35;
            Button22.Height = 40;
            Button22.NotPressedColor = ColorExtensions.RGB16(250, 240, 230);
        }
    }
}
